<%@include file="startUpIncludes.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
            Convert lead to Account
        </title>
    <script type="text/javascript" src="../js/modalwin.js">
    </script>
<!--     <script type="text/javascript" src="../js/validation.js"> -->
    </script>
<!--     <script type="text/javascript" src="../js/validationLeadForm.js"> -->
    </script>
 </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="modal-win-bg">
        <div class="modal-win-box">
            <div class="modal-win-hd">
                <span class="modal-win-title"></span>
                <span class="modal-win-close">x</span>
            </div>
            <div class="modal-win-content"></div>
            <a class="form-btn modal-win-ok">OK</a>
        </div>
    </div>
    <div class="wrap">
	<div class="fitBG">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="leads" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3>Convert Lead</h3>
                <form:form ccsClass="new-lead-form" commandName="convertForm" method="post" action="/sales/s/convert-lead">
                <input type="hidden" value="${lead.id}" name="leadId"/>
                <form:hidden value="${userDetails.id}" name="empId" path="empId"/>
                <form:errors path="*" cssClass="error-block" element="div" />
                <div class="btns">
                <input type="submit" value="Convert" class="form-btn"/><a href="/sales/s/leads" class="form-btn">Cancel</a>
                </div>
                <div class="form-row">
                    <h4>Account Information</h4>
					<span class="required-error">These fields are requied, please make sure to fill them all.</span>
                    <div class="input-col">
                        <label>Account Owner  *:</label>
                        <form:input path="accountOwner" cssClass="TB"/>
                        <label>Account Name   * : </label>
                        <form:input path="accountName" cssClass="TB"/>
                    </div>
                    <div class="input-col">
                        <label>Converted Status: </label>
                        <form:select cssClass="TB" path="convertedStatus">
                        <c:forEach items="${leadStatus}" varStatus="leadStat">
                        	<c:choose>
                        		<c:when test="${leadStatus[leadStat.index].name == lead.leadStatus}">
                        			<form:option value="${leadStat.index}">${leadStatus[leadStat.index].name}</form:option>
                        		</c:when>
                        		<c:otherwise>
                        			<form:option value="${leadStat.index}">${leadStatus[leadStat.index].name}</form:option>
                        		</c:otherwise>
                        	</c:choose>
                            
                        </c:forEach>
                        </form:select>
                    </div>
                </div>
                <div class="form-row">
                    <h4>Additional Information</h4>
                    <div class="input-col">
                        <label>Subject  *: </label>
                        <form:input type="text" cssClass="TB" path="subject"/>
                        <label>Date   *: </label>
                         <jsp:include page="calendar-jquery.jsp" >
							<jsp:param value="datepicker" name="inputDateId"/>
						</jsp:include>
						<form:input  cssClass="TB" id="datepicker" path="newDate"/>
                        <label>Comments: </label>
						<form:textarea cssClass="TB" path="comments"></form:textarea>
                    </div>
                    <div class="input-col">
                        <label>Status: </label>
                        <form:select  cssClass="TB" path="status">
                            <c:forEach items="${status}" varStatus="stat">
	                        	<form:option value="${stat.index}">${status[stat.index].name}</form:option>
	                        </c:forEach>
						</form:select>
                        <label>Priority: </label>
                        <form:select  cssClass="TB" path="priority">
	                        <c:forEach items="${priorities}" varStatus="priority">
	                        	<form:option value="${priority.index}">${priorities[priority.index].name}</form:option>
	                        </c:forEach>
           				</form:select>
                    </div>
                </div>
                <div class="btns">
                <input type="submit" value="Convert" class="form-btn"/><a href="/sales/s/leads" class="form-btn">Cancel</a>
                </div>
                </form:form>
                </div>
            </div>
        </div>
        
	<%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>